package cn.com.tarotframework.server.oauth.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * copyright (C), 2022, 塔罗牌基础架构
 *
 * @program tarot-core
 * @description 用户信息试图处理类
 * @author Jiang Xincan
 * @version 0.0.1
 * @date 2024/01/20 18:54
 **/
@Schema(title = "用户信息VO", description = "返回用户信息试图")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class LoginVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 4699955255353301288L;

    @Schema(name = "id", description = "用户ID（雪花算法）", defaultValue = "106991418777559040")
    private String id;

    @Schema(name = "account", description = "用户登录名称", type = "String", defaultValue = "tarot")
    private String account;

    @Schema(name = "password", description = "用户登录密码", type = "String", defaultValue = "123456")
    private String password;

    @Schema(name = "name", description = "用户名称", type = "String", defaultValue = "塔罗牌", example = "塔罗牌")
    private String name;

    @Schema(name = "phone", description = "用户电话", type = "String", defaultValue = "18503455667")
    private String phone;

    @Schema(name = "email", description = "用户邮箱", type = "String", defaultValue = "tarot@163.com")
    private String email;

    @Schema(name = "address", description = "用户地址", type = "String", defaultValue = "北京市海淀区西直门")
    private String address;

    @Schema(name = "sex", description = "用户性别", type = "Integer", defaultValue = "1")
    private Integer sex;

    @Schema(name = "createUserId",description = "创建人员ID",  type = "String", defaultValue = "106991418777559040",example = "106991418777559040")
    private String createUserId;

    @Schema(name = "createTime", description = "创建时间", type = "LocalDateTime", defaultValue = "2022-12-12 23:23:23",example = "2022-12-12 23:23:23")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    @Schema(name = "editUserId", description = "编辑人员ID", type = "String", defaultValue = "106991418777559040",example = "106991418777559040")
    private String editUserId;

    @Schema(name = "editTime", description = "编辑时间", type = "LocalDateTime", defaultValue = "2022-12-12 23:23:23",example = "2022-12-12 23:23:23")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime editTime;

}
